var template = function(a, b) {
    return template["object" == typeof b ? "render" : "compile"].apply(template, arguments)
};
!
    function(a, b) {
        "use strict";
        var c, d, e, f, g, h, i, j, k, l;
        a.version = "1.4.0", a.openTag = "<%", a.closeTag = "%>", a.parser = null, a.render = function(a, b) {
            var c = k(a);
            return void 0 === c ? l({
                id: a,
                name: "Render Error",
                message: "Not Cache"
            }) : c(b)
        }, a.compile = function(b, d) {
            function e(c) {
                try {
                    return new g(c).template
                } catch (e) {
                    return f ? (e.id = b || d, e.name = "Render Error", e.source = d, l(e)) : a.compile(b, d, !0)(c)
                }
            }

            var g, f = arguments[2];
            "string" != typeof d && (f = d, d = b, b = null);
            try {
                g = j(d, f)
            } catch (h) {
                return h.id = b || d, h.name = "Syntax Error", l(h)
            }
            return e.prototype = g.prototype, e.toString = function() {
                return g.toString()
            }, b && (c[b] = e), e
        }, a.helper = function(a, b) {
            i[a] = b
        }, c = {}, d = "".trim, e = d && !b.document, f = {}, g = function() {
            var a = Array.prototype.forEach ||
                function(a, b) {
                    var d, c = this.length >>> 0;
                    for (d = 0; c > d; d++) d in this && a.call(b, this[d], d, this)
                };
            return function(b, c) {
                a.call(b, c)
            }
        }(), h = Object.create ||
            function(a) {
                function b() {}

                return b.prototype = a, new b
            }, i = a.prototype = {
            $forEach: g,
            $render: a.render,
            $getValue: function(a) {
                return void 0 === a ? "" : a
            }
        }, g("break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield".split(","), function(a) {
            f[a] = !0
        }), j = function(b, c) {
            function e(a) {
                return r += a.split(/\n/).length - 1, a = a.replace(/('|"|\\)/g, "\\$1").replace(/\r/g, "\\r").replace(/\n/g, "\\n"), a = u[1] + "'" + a + "'" + u[2], a + "\n"
            }

            function j(a) {
                var b = r;
                return o ? a = o(a) : c && (a = a.replace(/\n/g, function() {
                    return r++, "$line=" + r + ";"
                })), 0 === a.indexOf("=") && (a = a.substring(1).replace(/[\s;]*$/, ""), d && (a = "$getValue(" + a + ")"), a = u[1] + a + u[2]), c && (a = "$line=" + b + ";" + a), k(a), a + "\n"
            }

            function k(a) {
                a = a.replace(/\/\*.*?\*\/|'[^']*'|"[^"]*"|\.[\$\w]+/g, ""), g(a.split(/[^\$\w\d]+/), function(a) {
                    if (/^this$/.test(a)) throw {
                        message: 'Prohibit the use of the "' + a + '"'
                    };
                    !a || f.hasOwnProperty(a) || /^\d/.test(a) || s.hasOwnProperty(a) || (l(a), s[a] = !0)
                })
            }

            function l(a) {
                var b;
                b = "print" === a ? w : "include" === a ? x : i.hasOwnProperty(a) ? "$helpers." + a : "$data." + a, t += a + "=" + b + ","
            }

            var y, z, m = a.openTag,
                n = a.closeTag,
                o = a.parser,
                p = b,
                q = "",
                r = 1,
                s = {
                    $out: !0,
                    $line: !0
                },
                t = "var $helpers=this," + (c ? "$line=0," : ""),
                u = d ? ["$out='';", "$out+=", ";", "$out"] : ["$out=[];", "$out.push(", ");", "$out.join('')"],
                v = d ? "if(content!==undefined){$out+=content;return content}" : "$out.push(content);",
                w = "function(content){" + v + "}",
                x = "function(id,data){if(data===undefined){data=$data}var content=$helpers.$render(id,data);" + v + "}";
            g(p.split(m), function(a) {
                a = a.split(n);
                var c = a[0],
                    d = a[1];
                1 === a.length ? q += e(c) : (q += j(c), d && (q += e(d)))
            }), p = q, c && (p = "try{" + p + "}catch(e){" + "e.line=$line;" + "throw e" + "}"), p = t + u[0] + p + "this.template=" + u[3];
            try {
                return y = new Function("$data", p), z = y.prototype = h(i), z.toString = function() {
                    return this.template
                }, y
            } catch (A) {
                throw A.temp = "function anonymous($data) {" + p + "}", A
            }
        }, k = function(b) {
            var f, d = c[b];
            return void 0 !== d || e ? c.hasOwnProperty(b) ? d : void 0 : (f = document.getElementById(b), f && a.compile(b, f.value || f.innerHTML), c[b])
        }, l = function(a) {
            function c() {
                return c + ""
            }

        }
    }(template, this), "undefined" != typeof module && module.exports && (module.exports = template), function(a) {
    "use strict";
    "function" == typeof define && define.amd ? define(["jquery"], a) : "undefined" != typeof module && module.exports ? module.exports = a(require("jquery")) : a(jQuery)
}(function(a) {
    "use strict";

    function b(b) {
        return !b.nodeName || -1 !== a.inArray(b.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"])
    }

    function c(b) {
        return a.isFunction(b) || a.isPlainObject(b) ? b : {
            top: b,
            left: b
        }
    }

    var d = a.scrollTo = function(b, c, d) {
        return a(window).scrollTo(b, c, d)
    };
    return d.defaults = {
        axis: "xy",
        duration: 0,
        limit: !0
    }, a.fn.scrollTo = function(e, f, g) {
        "object" == typeof f && (g = f, f = 0), "function" == typeof g && (g = {
            onAfter: g
        }), "max" === e && (e = 9e9), g = a.extend({}, d.defaults, g), f = f || g.duration;
        var h = g.queue && 1 < g.axis.length;
        return h && (f /= 2), g.offset = c(g.offset), g.over = c(g.over), this.each(function() {
            function i(b) {
                var c = a.extend({}, g, {
                    queue: !0,
                    duration: f,
                    complete: b &&
                    function() {
                        b.call(k, m, g)
                    }
                });
                l.animate(n, c)
            }

            var o, j, k, l, m, n, p;
            if (null !== e) {
                switch (j = b(this), k = j ? this.contentWindow || window : this, l = a(k), m = e, n = {}, typeof m) {
                    case "number":
                    case "string":
                        if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(m)) {
                            m = c(m);
                            break
                        }
                        if (m = j ? a(m) : a(m, k), !m.length) return;
                    case "object":
                        (m.is || m.style) && (o = (m = a(m)).offset())
                }
                p = a.isFunction(g.offset) && g.offset(k, m) || g.offset, a.each(g.axis.split(""), function(a, b) {
                    var c = "x" === b ? "Left" : "Top",
                        e = c.toLowerCase(),
                        f = "scroll" + c,
                        q = l[f](),
                        r = d.max(k, b);
                    o ? (n[f] = o[e] + (j ? 0 : q - l.offset()[e]), g.margin && (n[f] -= parseInt(m.css("margin" + c), 10) || 0, n[f] -= parseInt(m.css("border" + c + "Width"), 10) || 0), n[f] += p[e] || 0, g.over[e] && (n[f] += m["x" === b ? "width" : "height"]() * g.over[e])) : (c = m[e], n[f] = c.slice && "%" === c.slice(-1) ? parseFloat(c) / 100 * r : c), g.limit && /^\d+$/.test(n[f]) && (n[f] = 0 >= n[f] ? 0 : Math.min(n[f], r)), !a && 1 < g.axis.length && (q === n[f] ? n = {} : h && (i(g.onAfterFirst), n = {}))
                }), i(g.onAfter)
            }
        })
    }, d.max = function(c, d) {
        var g, h, e = "x" === d ? "Width" : "Height",
            f = "scroll" + e;
        return b(c) ? (e = "client" + e, g = c.ownerDocument || c.document, h = g.documentElement, g = g.body, Math.max(h[f], g[f]) - Math.min(h[e], g[e])) : c[f] - a(c)[e.toLowerCase()]()
    }, a.Tween.propHooks.scrollLeft = a.Tween.propHooks.scrollTop = {
        get: function(b) {
            return a(b.elem)[b.prop]()
        },
        set: function(b) {
            var d, c = this.get(b);
            return b.options.interrupt && b._last && b._last !== c ? a(b.elem).stop() : (d = Math.round(b.now), c !== d && (a(b.elem)[b.prop](d), b._last = this.get(b)), void 0)
        }
    }, d
}), function() {
    var a = {
        dom: {}
    };
    a.init = function() {
        var e, f, g, a = this,
            b = 10,
            c = 36,
            d = [ {
                    title: "常用字体",
                    list: [
                        {name: '宋体', value: '宋体, SimSun'},
                        {name: '黑体', value: '黑体, SimHei'},
                        {name: '微软雅黑', value: '微软雅黑'},
                        {name: '新宋体', value: 'NSimSun'},
                        {name: '楷体', value: '楷体, KaiTi, 楷体_GB2312, SimKai'},
                        {name: '仿宋', value: '仿宋, FangSong'},
                        {name: '隶书', value: '隶书, SimLi, LiSu'},
                        {name: '华文细黑', value: 'STXihei'},
                        {name: '幼圆', value: 'YouYuan'},
                        {name: 'arial', value: 'arial, helvetica, sans-serif'},
                        {name: 'impact', value: 'impact, chicago'}
                        ]
                }];
        for (a.dom.doc = $("body"),
             a.dom.fontSetBtn = $("#font_set_btn"),//加载系统字体列表
             a.dom.fontList = $("#font_list"),//字体列表
             a.dom.fontSizeRange = $("#font_size_range"),//滑动更改字体大小
             a.dom.fontSizeSelect = $("#font_size_select"),//下拉列表：字体大小
             a.dom.fontBold = $("#font_bold"),//加粗
             a.dom.fontItalic = $("#font_italic"),//斜体
             a.dom.fontColor = $("#font_color"),//颜色选择器
             a.dom.fontSample = $("#font_sample"),//接收样式变化的标题
             e = document.getElementById('font_sample').style.fontSize,
             f = template.render("tmp_font", {
                list: d
            }), a.dom.fontSample.append(f), f = '<option value="">默认字体</option>', $.each(d, function(a, b) {
                f += '<optgroup label="' + b.title + '">';
                for (var c = 0, d = b.list.length; d > c; c++)
                    f += '<option value="' + b.list[c].value + '">',
                    f += "string" == typeof b.list[c] ? b.list[c] : b.list[c].name,
                    f += "</option>";
                f += "</optgroup>"
            }), a.dom.fontList.html(f).val(document.getElementById('font_sample').style.fontFamily), "range" != a.dom.fontSizeRange.attr("type") && a.dom.fontSizeRange.hide(), a.dom.fontSizeRange.attr({
                min: b,
                max: c
            }), a.dom.fontSizeRange.val(e), f = "<option value=''>默认大小</option>", g = b; c >= g; g = g+2) f += '<option value="' + g + 'px">' + g + "px</option>";
            a.dom.fontSizeSelect.html(f).val(e),
                a.dom.fontList.on("change", function() {
                    console.log( this.value);
                a.dom.fontSample.css("font-family", this.value);
            }), a.dom.fontSizeRange.on("change", function() {
                a.dom.fontSizeSelect.val(this.value), a.dom.fontSample.css("fontSize", this.value)
            }), a.dom.fontSizeSelect.on("change", function() {
                a.dom.fontSizeRange.val(this.value), a.dom.fontSample.css("fontSize", this.value)
            }), a.dom.fontBold.prop("checked", a.dom.fontSample.css("font-weight")=="700" ? true : false), a.dom.fontBold.on("change", function() {
                var b = a.dom.fontBold.prop("checked") ? "bold" : "normal";
                a.dom.fontSample.css("fontWeight", b)
            }), a.dom.fontItalic.prop("checked", a.dom.fontSample.css("font-style")=="italic" ? true : false), a.dom.fontItalic.on("change", function() {
                var b = a.dom.fontItalic.prop("checked") ? "italic" : "normal";
                a.dom.fontSample.css("fontStyle", b)
            }), a.dom.fontColor.cxColor({color:a.dom.fontSample.css("color")}), a.dom.fontColor.on("change", function() {
                a.dom.fontSample.css("color", this.value)
            }), swfobject.hasFlashPlayerVersion("9.0.0") && a.dom.fontSetBtn.on("click", a.loadSystemFonts.bind(a))
    }, a.loadSystemFonts = function() {
        var a = this;
        $("<div></div>", {
            id: "font-detect-swf"
        }).appendTo("body"), a.dom.fontSetBtn.html("正在加载字体，请稍等..").prop("disabled", !0), a.dom.fontSetList = $("<select></select>", {
            id: "font_set_list",
            "class": "select"
        }), new FontDetect("font-detect-swf", a.dom.fontSetBtn.val(), function(b) {
            var e, c = b.fonts(),
                d = '<option value="">选择字体</option>';
            for (e = 0; e < c.length; e++) d += '<option value="' + c[e].fontName + '">' + c[e].fontName + "</option>";
            a.dom.fontSetBtn.remove(), a.dom.fontSetList.html(d), a.dom.fontSetList.on("change", function() {
                a.setFontFamily(this.value)
            })
        })
    }, a.init()
}();